﻿using System;
using System.Collections.Generic;
using Microsoft.Windows.Data.DomainServices;
using MVVMtutorialAdvanced.Web;

// http://weblogs.asp.net/dwahlin/archive/2010/12/20/wcf-ria-services-domaincontext-abstraction-strategies-say-that-10-times.aspx

namespace MVVMtutorialAdvanced.DomainServices
{
	public interface IDomainServiceBook
	{
		void GetCountries(Action<IEnumerable<CountryDTO>, Exception> callback);

		void GetAuthors(Action<IList<AuthorDTO>, Exception> callback); // IEnumerable -> read only
		void InsertAuthor(AuthorDTO author, Action<Exception> callback);
		void DeleteAuthor(AuthorDTO author, Action<Exception> callback);
		void UpdateAuthor(AuthorDTO author, Action<Exception> callback);

		//void GetBooks(Action<IList<BookDTO>, Exception> callback);
		void GetBooks(Action<DomainCollectionView<BookDTO>, Exception> callback);
		void InsertBook(BookDTO book, Action<Exception> callback);
		void DeleteBook(BookDTO book, Action<Exception> callback);
		void UpdateBook(BookDTO book, Action<Exception> callback);

		void RejectChanges();
		void AcceptChanges();
	}
}
